package com.hwh.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.hwh.daoIm.OrdersDaoImp;
import com.hwh.vo.Orders;

public class SelBuyerOrderController extends HttpServlet{

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) 
	         throws ServletException, IOException {
      super.doPost(req, resp);
   }
	
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		int i = 4;
		ArrayList<Orders> orders= new ArrayList<Orders>();
		OrdersDaoImp odi = new OrdersDaoImp();
       
       
		orders= odi.getBuyerOrders(i);
       
       //将orders对象放入session中,前台用EL表达式获取值
       HttpSession session= req.getSession();
       
       session.setAttribute("orders", orders);
       
       req.getRequestDispatcher("myorders.jsp").forward(req, resp);
		
		
		
	}
	
}
